﻿using System.Data;
using System.Data.SqlClient;

namespace DataAccess
{
    public class DaReport
    {
        public DataTable selReportDetailed(string sql)
        {

            string strCommandText = sql;
            return SqlHelper.ExecuteData(CommandType.Text, strCommandText, null);
        }

        public DataTable repTimeTotal(int month, int year, int id, string companyid)
        {
            string strCommandText = "repTimeTotal" + companyid;
            SqlParameter[] paraLocal = new SqlParameter[3];
            paraLocal[0] = new SqlParameter("@Month", month);
            paraLocal[1] = new SqlParameter("@Year", year);
            paraLocal[2] = new SqlParameter("@Id", id);
            return SqlHelper.ExecuteData(CommandType.StoredProcedure, strCommandText, paraLocal);
        }

        public DataTable repTimeCumulative(int month, int year, int resultUnitID, string companyid)
        {
            string strCommandText = "repTimeCumulative" + companyid;
            SqlParameter[] paraLocal = new SqlParameter[3];
            paraLocal[0] = new SqlParameter("@Month", month);
            paraLocal[1] = new SqlParameter("@Year", year);
            paraLocal[2] = new SqlParameter("@ResultUnitID", resultUnitID);
            return SqlHelper.ExecuteData(CommandType.StoredProcedure, strCommandText, paraLocal);
        }
    }
}
